<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./首页.css">
    <link rel="stylesheet" href="./font/iconfont.css">
</head>

<body>
    <header>
        <span class="logo">9466云专题</span>
        <div class="user"><span class=" iconfont icon-yonghu"></span><span>龙猫(9466云专题)</span></div>
    </header>
    <div class="container">
        <ul class="aside">
            <li><span class="iconfont icon-shouye"></span>首页</li>
            <li><span class="iconfont icon-zhuantiguanli"></span> 专题</li>
            <li class="active"><span class="iconfont icon-yonhu"></span> 用户</li>
            <li><span class="iconfont icon-shezhi-xianxing"></span> 设置</li>
            <li><span class="iconfont icon-xitongrizhi"></span> 日志</li>
        </ul>
        <main>
            <input type="text" placeholder="搜索用户">
            <button class="search">搜索</button>
            <br>
            <button class="add"><span class="iconfont icon-jiahao"></span>添加用户</button>
            <table>
                <thead>
                    <tr>
                        <th>邮箱(帐户)</th>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>所属组</th>
                        <th>管理员</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- <tr>
                        <td>123123123@qq.com</td>
                        <td>李彦慧</td>
                        <td>13611129070</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td><span class="statusok">正常</span></td>
                        <td><span class="iconfont icon-xiugai"></span> <span class="iconfont icon-shanchu"></span></td>
                    </tr>
                    <tr>
                        <td>123123123@qq.com</td>
                        <td>李彦慧</td>
                        <td>13611129070</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td><span class="statusok">正常</span></td>
                        <td><span class="iconfont icon-xiugai"></span> <span class="iconfont icon-shanchu"></span></td>
                    </tr> -->
                </tbody>
            </table>
            <div class="foot">
                <span>上一页</span>
                <span>下一页</span>
            </div>
        </main>

    </div>
    </div>
</body>

</html>
<script src="./promise封装ajax.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.0/mock.js"></script>
<script src="./mockdatas.js"></script>

<script>
    render(data.list)

    function render(data) {
        var str = data.map((item,index)=>{
            return`<tr>
                <td>${item.email}</td>
                <td>${item.name}</td>
                <td>${item.phone}</td>
                <td>${item.ingroup}</td>
                <td>${item.isadmin?'是':'否'}</td>
                <td><span class="statusok">${item.status?'正常':'异常'}</span></td>
                <td><span class="iconfont icon-xiugai"></span> <span class="iconfont icon-shanchu"></span></td>
            </tr>
            `
        }).join('')
        document.querySelector('tbody').innerHTML=str
    }

</script>